<template>
    <div :class="[selected ? 'rightCome' : 'rightLeave', 'view2']">
        {{selected}}
    </div>
</template>

<script>
export default {
    name: "view2",
    props: ["selected"],
    mounted() {
        console.log(this.selected)
    }
}
</script>

<style scoped>
.view2 {
    flex: 1;
    display: flex;
}
.view2 div {
    flex: 1;
}
.view2 div:nth-of-type(1) {
    background-color: pink;
}
.view2 div:nth-of-type(2) {
    background-color: blue;
}
</style>